-- _ENV.import("test/test.lua");
-- if (not commonlib.IsEmscriptenPlatform()) then
--     _ENV.import("test/test_blockengine.lua");
-- end

_ENV.import("test/test_window.lua")
-- commonlib.echo("==============================main================================")
-- commonlib.ShowVueWindow({
--     url = commonlib.GetFullPath("@script/debugger/test.html"),
-- });
-- commonlib.SetInterval(0, function()
--     print("timer")
-- end)

-- commonlib.run(function()
--     local i = 0;
--     while(i < 10) do
--         i = i + 1;
--         commonlib.sleep(2000);
--     end
-- end)
-- print(__directory__ .. "test.html");
-- _G.window = commonlib.ShowWindow({
--     url = __directory__ .. "test.html";
-- });

-- local o = setmetatable({key = 1}, {__index = {value = 2}})
-- print(o.key, o.value)
-- for key, value in pairs(o) do
--     print(key, value)
-- end

-- __debugger__();
-- local BaseElement = import("./window/Element/BaseElement.lua");
-- local element = BaseElement:new();
-- element:SetPosition(100, 100, 300, 300);
-- element:SetBackgroundColor(0x00ff0099);

-- local begin_time = commonlib.GetTimeStamp();
-- commonlib.WindowPainter:DrawRectangle(0, 00, 300, 300, 0xff0000ff, 0);
-- -- commonlib.WindowPainter:DrawRectangle(0, 0, 200, 200, 0xff00000f, 0);
-- commonlib.WindowPainter:DrawRectangle(200, 200, 200, 200, 0x00ff0099, 0);

-- commonlib.WindowPainter:Flush();
-- for i = 0, 2048  do
--     for j = 0, 2048 do
--         local k = i * j / 0.5;
--         -- commonlib.SetWindowPixel(i, j, 0x00ff00ff);
--         -- commonlib.SetWindowPixel(i, j, element:GetPixelByXY(i, j));
--     end
-- end
-- local end_time = commonlib.GetTimeStamp();
-- print("=============耗时", end_time - begin_time)
-- for i = 100, 200  do
--     for j = 100, 200 do
--         -- commonlib.SetWindowPixel(i, j, element:GetPixelByXY(i, j));
--         -- commonlib.SetWindowPixel(i, j, 0xff0000ff);
--         commonlib.SetWindowPixel(i, j, 0x00ff00ff);
--     end
-- end
